Optimal. Leaf size=44 \[ -\frac{a \sin ^3(c+d x)}{3 d}+\frac{a \sin (c+d x)}{d}-\frac{b \cos ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0646631, antiderivative size = 44, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 4, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {3090, 2633, 2565, 30} \[ -\frac{a \sin ^3(c+d x)}{3 d}+\frac{a \sin (c+d x)}{d}-\frac{b \cos ^3(c+d x)}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3090
Rule 2633
Rule 2565
Rule 30
Rubi steps
\begin{align*} \int \cos ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x)) \, dx &=\int \left (a \cos ^3(c+d x)+b \cos ^2(c+d x) \sin (c+d x)\right ) \, dx\\ &=a \int \cos ^3(c+d x) \, dx+b \int \cos ^2(c+d x) \sin (c+d x) \, dx\\ &=-\frac{a \operatorname{Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{d}-\frac{b \operatorname{Subst}\left (\int x^2 \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac{b \cos ^3(c+d x)}{3 d}+\frac{a \sin (c+d x)}{d}-\frac{a \sin ^3(c+d x)}{3 d}\\ \end{align*}
Mathematica [A] time = 0.0116904, size = 44, normalized size = 1. \[ -\frac{a \sin ^3(c+d x)}{3 d}+\frac{a \sin (c+d x)}{d}-\frac{b \cos ^3(c+d x)}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.037, size = 36, normalized size = 0.8 \begin{align*}{\frac{1}{d} \left ({\frac{a \left ( 2+ \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) }{3}}-{\frac{ \left ( \cos \left ( dx+c \right ) \right ) ^{3}b}{3}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.18483, size = 47, normalized size = 1.07 \begin{align*} -\frac{b \cos \left (d x + c\right )^{3} +{\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a}{3 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.47403, size = 90, normalized size = 2.05 \begin{align*} -\frac{b \cos \left (d x + c\right )^{3} -{\left (a \cos \left (d x + c\right )^{2} + 2 \, a\right )} \sin \left (d x + c\right )}{3 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.513386, size = 63, normalized size = 1.43 \begin{align*} \begin{cases} \frac{2 a \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac{a \sin{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} - \frac{b \cos ^{3}{\left (c + d x \right )}}{3 d} & \text{for}\: d \neq 0 \\x \left (a \cos{\left (c \right )} + b \sin{\left (c \right )}\right ) \cos ^{2}{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.13003, size = 74, normalized size = 1.68 \begin{align*} -\frac{b \cos \left (3 \, d x + 3 \, c\right )}{12 \, d} - \frac{b \cos \left (d x + c\right )}{4 \, d} + \frac{a \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac{3 \, a \sin \left (d x + c\right )}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]